package com.example.j20240313springmvc.service;

import com.example.j20240313springmvc.mapper.MessageMapper;
import com.example.j20240313springmvc.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    MessageMapper messageMapper;
    public Boolean publish(Message message) {
        messageMapper.insertMessage(message);
        return true;
    }
    public List<Message> getMessages() {
        return messageMapper.SelectAllMessage();
    }
}
